#ifndef CONNECTION_FACTORY_H
#define CONNECTION_FACTORY_H

#include "../editors/items/abstractlinegraphicitem.h"

#include <QtCore/QHash>

namespace swp
{

class ConnectionFactory
{
public:
    static ConnectionFactory* getInstance();
    static void destroy();

    void registerGraphicItemForConnection(unsigned int connectionId,
        AbstractLineGraphicItem* item);
    void unregisterGraphicItemForConnection(unsigned int connectionId);
    AbstractLineGraphicItem* graphicItemForConnection(
        unsigned int connectionId) const;

private:
    ConnectionFactory();
    ~ConnectionFactory();

private:
    QHash<unsigned int, AbstractLineGraphicItem*> m_registeredGraphicItems;
};

} // namespace swp

#endif
